<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * PHP version 5.3.0
 * 
 * @category  allyoung
 * @author    ____author____ 
 * @copyright ____copyright____
 * @license   ____license____
 * @version   GIT: $Id:
 * @link      http://www.vmrf.ru/
 * @see       ____file_see____
 * @since     1.0.0
 */

if (defined('AY_INITIALIZED')) {
	return false;
}

define('AY_INITIALIZED', true);

// {{{ Configuration

define('AY_DIR_WEBROOT', realpath(__DIR__ . '/../../..'));
define('AY_DIR_LIB', __DIR__ . '/lib');
// }}} 


// {{{ Define autoloader and preload some classes

function ay_autoload($className)
{
    list($namespace) = explode('\\', $className);

    if ('AY' == $namespace ) {

        // For EMM  classes
        require_once (
            AY_DIR_LIB . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php'
        );

    }
}

spl_autoload_register('ay_autoload');

// }}}

// {{{ Quick access helper

/**
 * Quick access helper
 *
 * @param boolean $reset Reset flag
 *
 * @return \AY\Core\QuickAccess
 * @see    ____func_see____
 * @since  1.0.0
 */
function ay($reset = false)
{
    static $obj;

    if (!isset($obj) || $reset) {
        $obj = new \AY\Core\QuickAccess();
    }

    return $obj;
}

// }}}

